import request from '../utils/request';
import constant from '../constant/constant'
import qs from 'qs';

/**
 * 获取模型工具外部链接
 */
export function getToolHtml(payload){
    let option = {
        method: 'GET',
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        mode: "cors",
    }

    return request(constant.serverUrl + '/tvs/api/policy/readurl', option)
}

/**
 * 修改模型工具外部链接
 */
export function repairToolHtml(payload){
    let option = {
        method: 'POST',
        body: qs.stringify(payload),
        headers: {
            "Content-Type": "application/x-www-form-urlencoded"
        },
        mode: "cors",
    }

    return request(constant.serverUrl + '/tvs/api/policy/writeurl', option)
}